package com.winit.agent.model;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name = "matrix_agent_workspace")
public class AgentWorkspace implements Serializable{
    private String wsId;
    private String wsPort;
    private String agentId;
    private String wsCode;
    private String wsPath;
    private String isDefault;
    @Column(name = "prd_id")
    private String prdId;

    @Id
    @Column(name = "ws_id")
    public String getWsId() {
        return wsId;
    }

    public void setWsId(String wsId) {
        this.wsId = wsId;
    }

    @Basic
    @Column(name = "ws_port")
    public String getWsPort() {
        return wsPort;
    }

    public void setWsPort(String wsPort) {
        this.wsPort = wsPort;
    }

    @Basic
    @Column(name = "agent_id")
    public String getAgentId() {
        return agentId;
    }

    public void setAgentId(String agentId) {
        this.agentId = agentId;
    }

    @Basic
    @Column(name = "ws_code")
    public String getWsCode() {
        return wsCode;
    }

    public void setWsCode(String wsCode) {
        this.wsCode = wsCode;
    }

    @Basic
    @Column(name = "ws_path")
    public String getWsPath() {
        return wsPath;
    }

    public void setWsPath(String wsPath) {
        this.wsPath = wsPath;
    }

    @Basic
    @Column(name = "is_default")
    public String getIsDefault() {
        return isDefault;
    }

    public void setIsDefault(String isDefault) {
        this.isDefault = isDefault;
    }

    public String getPrdId() {
        return prdId;
    }

    public void setPrdId(String prdId) {
        this.prdId = prdId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AgentWorkspace that = (AgentWorkspace) o;

        if (wsId != null ? !wsId.equals(that.wsId) : that.wsId != null) return false;
        if (wsPort != null ? !wsPort.equals(that.wsPort) : that.wsPort != null) return false;
        if (agentId != null ? !agentId.equals(that.agentId) : that.agentId != null) return false;
        if (wsCode != null ? !wsCode.equals(that.wsCode) : that.wsCode != null) return false;
        if (wsPath != null ? !wsPath.equals(that.wsPath) : that.wsPath != null) return false;
        if (isDefault != null ? !isDefault.equals(that.isDefault) : that.isDefault != null) return false;
        if (prdId != null ? !prdId.equals(that.prdId) : that.prdId != null) return false;
        return true;
    }

    @Override
    public int hashCode() {
        int result = wsId != null ? wsId.hashCode() : 0;
        result = 31 * result + (wsPort != null ? wsPort.hashCode() : 0);
        result = 31 * result + (agentId != null ? agentId.hashCode() : 0);
        result = 31 * result + (wsCode != null ? wsCode.hashCode() : 0);
        result = 31 * result + (wsPath != null ? wsPath.hashCode() : 0);
        result = 31 * result + (isDefault != null ? isDefault.hashCode() : 0);
        result = 31 * result + (prdId != null ? prdId.hashCode() : 0);
        return result;
    }


}
